package com.lightdz.tshirtdz.controller;

import com.lightdz.tshirtdz.bll.ProductBll;
import com.lightdz.tshirtdz.model.api.ApiPStyle;
import com.lightdz.tshirtdz.model.api.ApiProduct;
import com.lightdz.tshirtdz.model.api.ApiResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ Description：商品信息
 * @ Author     ：zbl
 * @ Date       ：Created in 15:52 09/08/2018
 * @ Modified By：
 */
@RestController
@RequestMapping(value = "/product")
public class ProductController {

    @Autowired
    ProductBll productBll;

    /**
     * 获取商品详情页信息
     */
    @GetMapping(value = "/pdetail")
    public ApiResponse<ApiProduct> getPDetail(String wxId, long pid) {
        return productBll.getApiProduct(wxId, pid);
    }

    /**
     * 获取商品尺码颜色等信息
     */
    @GetMapping(value = "/pstyle")
    public ApiResponse<ApiPStyle> getPStyle(long pid) {
        return productBll.getPStyle(pid);
    }
}
